<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        var arr = [1,3,5,7,11,22,8,2,33]
        function fun1(value1,value2){
            if(value1>value2){
                return 1
            }else if(value1<value2){
                return -1
            }else{
                return 0
            }
        }
        console.log(arr.reverse(),"倒序排列")
        console.log(arr,"原数组")
        // var result = arr.sort(fun1)
        // console.log(result,"排序结果")
        // var result2 = arr.sort((a,b)=>{a>b?1:a<b?-1:0})
        // console.log(result2,"排序结果")
        
    </script>
</head>
<body>
    
</body>
</html>